package com.woniu.order.client;

import com.woniu.order.client.param.AddOrderFlowingParam;
import com.woniu.order.client.param.OrderCreateParam;
import com.woniu.order.client.param.OrderEntryParam;
import com.woniu.order.client.result.OrderFlowingResultInfo;
import com.woniu.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
* name是项目名，contextId是client的名字
*/
@FeignClient(contextId = "orderManageClient",name="order")
public interface OrderManageClient {

    /**
     * 创建订单
     * @param orderCreateParam
     * @return
     */
    @PostMapping("createOrder")
    public Result createOrder(@RequestBody OrderCreateParam orderCreateParam) throws Exception;

    /**
     * 支付宝支付
     * @param orderId
     * @return
     */
    @GetMapping("aliPay")
    public void aliPay(@RequestParam("orderId")Integer orderId) throws Exception;


    /**
     *新增订单流水
     * @param addOrderFlowingParam
     * @return
     */
    @PostMapping("addOrderFlowing")
    public Result<OrderFlowingResultInfo> addOrderFlowing(@RequestBody AddOrderFlowingParam addOrderFlowingParam);

}